<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="../20-eventListener.js"></script>
  <style>
    /* #outter{
      width: 200px;
      height:200px;
      background-color:#89c;
      position:relative;
    }
    #inner{
      width: 100px;
      height: 100px;
      background-color:rgb(153,106,34);
      position:relative;
      left:50px;
      top:50px;
    } */
  </style>
</head>
<body>

  <ul id="items">
    <li>AAAA</li>
    <li>BBBB</li>
    <li>CCCC</li>
    <li>DDDD</li>
  </ul>
  <script>
    //调用函数绑定事件
    addEventListener('#items','click',function(e){
      //输出标签文本
      console.log(this.innerHTML);
    },'li')
  </script>


























  <!-- <div id="outter">
    <div id="inner">
    </div>
  </div> -->
  <script>
    // //获取元素
    // let outter = document.querySelector('#outter')
    // let inner = document.querySelector('#inner')

    // outter.addEventListener('click',function(){
    //   console.log('捕获outter');
    // },true)

    // inner.addEventListener('click',function(){
    //   console.log('捕获inner');
    // },true)

    // outter.addEventListener('click',function(){
    //   console.log('冒泡outter');
    // })

    // inner.addEventListener('click',function(){
    //   console.log('冒泡inner');
    // })
  </script>
</body>
</html>